package com.snow.campuslink.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.snow.campuslink.user.entity.UserFriendship;
import com.snow.campuslink.user.mapper.UserFriendshipMapper;
import com.snow.campuslink.user.service.IUserFriendshipService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import static cn.hutool.core.bean.BeanUtil.beanToMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gaosl
 * @since 2021-03-02
 */
@Service
public class UserFriendshipServiceImpl extends ServiceImpl<UserFriendshipMapper, UserFriendship> implements IUserFriendshipService {

    @Override
    public List<UserFriendship> getFocus(UserFriendship userFriendship) {
        Map<String, Object> map = beanToMap(userFriendship, true, true);
        QueryWrapper<UserFriendship> userFriendshipQueryWrapper = new QueryWrapper<>();
        userFriendshipQueryWrapper.allEq(map);
        return  list(userFriendshipQueryWrapper);
    }
}
